import json

from config import BASE_PATH


def read_json_file(filename):
    with open(filename, "r", encoding="utf8") as f:
        json_data = json.load(f)
        # print("json文件数据：", json_data)

    # 在 循环之前，创建空list
    list_data = []
    for i in json_data:
        # 提取value，转换成元组
        take_value = tuple(i.values())
        # 把拿到的value追加到空列表中
        list_data.append(take_value)

    # 循环结束后，返回列表
    return list_data


if __name__ == '__main__':
    # filename = r"D:\HeiMaTest\就业班五阶_接口自动化\bj53_day07_ApiAutoTestFramework\data\login_data.json"
    filename = BASE_PATH + r"\data\add_emp_data.json"
    ret = read_json_file(filename)
    print(ret)
